package com.hzx.sender;

import com.fasterxml.jackson.databind.ser.std.StringSerializer;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.kafka.core.KafkaTemplate;
import org.springframework.kafka.support.serializer.JsonSerializer;
import org.springframework.kafka.support.serializer.StringOrBytesSerializer;
import org.springframework.stereotype.Component;

@Component
public class KafkaSender {
    @Autowired
    KafkaTemplate<String, Object> kafkaTemplate;

    public void sendMessage(String topicName, Object message) {
        kafkaTemplate.send(topicName, message);
    }
}
